<template>
	<u-form :model="form" ref="uForm">
		
<!-- insert into return_goods(order_id, order_detail_id, return_goods_reason,before_user_id,return_goods_payment,return_goods_payment_type,return_goods_status,shipping_comp_name2,shipping_serial_number)
values (#{orderId}, #{orderDetailId}, #{returnGoodsReason}, #{beforeUserId}, #{returnGoodsPayment}, #{returnGoodsPaymentType}, 3, #{shippingCompName2}, #{shippingSerialNumber}) -->
		<u-form-item label="退货原因"><u-input v-model="form.returnGoodsReason" /></u-form-item>
		<u-form-item label="快递公司"><u-input v-model="form.shippingCompName2" /></u-form-item>
		<u-form-item label="快递编号"><u-input v-model="form.shippingSerialNumber" /></u-form-item>
		<!-- <u-form-item label="退款方式">
			<u-radio-group v-model="radio">
				<u-radio v-for="(item, index) in radioList" :key="index" :name="item.name" :disabled="item.disabled">
					{{ item.name }}
				</u-radio>
			</u-radio-group>
		</u-form-item> -->
		<u-button @click="submit">提交</u-button>
	</u-form>
</template>

<script>
export default {
	data() {
		return {
			form: {
				orderDetailId:undefined,
				beforeUserId:undefined,
				returnGoodsPayment:undefined,
				returnGoodsReason: undefined,
				shippingCompName2: undefined,
				shippingSerialNumber: undefined,
			},
			radioList: [
				{
					name: '鲜甜',
					disabled: false
				},
				{
					name: '麻辣',
					disabled: false
				}
			],
			radio: '',
		};
	},
	onLoad(options) {
		console.log(options)
		this.form.orderDetailId=options.orderDetailId,
		this.form.returnGoodsPayment=options.paymentMoney,
		this.form.orderId=options.orderId,
		uni.getStorage({
			key:'beforeUser',
			success: (res) => {
				this.form.beforeUserId = res.data.beforeUserId
				console.log(this.form)
			}
		})
		
			// this.shangpinid = options.shangpinid;
			// /* 商品信息 */
			// // this.getlunboList(options.goodsId);
			// this.getlunbotu()
	},
	methods: {
		submit(){
				uni.request({
					url:'http://localhost:8005/return/bgs/return-goods/zeroAddReturnGood',
					method:"POST",
					dataType:"JSON",
					data:this.form,
					success: (res) => {
						this.form={}
						uni.showToast({
							title: "提交成功",
							icon: "none"
						})
					}
				})
		}
		
	}
};
</script>